package com.blackhorse.demo.myBeanFactory.service;

import com.blackhorse.demo.myBeanFactory.dao.MyAccountDao;
import com.blackhorse.demo.myBeanFactory.factory.MyBeanFactory;

public class MyAccountServiceImplByFactory implements MyAccountService {

    //使用工厂模式解耦
    private MyAccountDao accountDao = MyBeanFactory.getBean("accountDao", MyAccountDao.class);

    @Override
    public void saveAccount() {
        accountDao.saveAccount();
    }
}
